
# =================================
# Paper title: It's All About Political Incentives: Democracy and the Renewable Feed-In Tariff
# Authors: Patrick Bayer (Glasgow) and Johannes Urpelainen (Columbia) 
# Journal of Politics

# Last modified: November 7, 2015

# Purpose: R code creates the mosaic plot in Figure 2(b)
# =================================

rm(list=ls())

FIT <- c(47,13)
NoFIT <- c(68,60)

data <- rbind(FIT,NoFIT)
colnames(data) <- c("Democracy","Autocracy")
rownames(data) <- c("FIT","No FIT")

#==============================
pdf("mosaic.pdf",height=6,width=6)
#==============================

par(mar=c(4,4,4,4))

# mosaicplot
mosaicplot(x=t(data),ylab="FIT adoption",xlab="Political institution",
main="FIT Adoption by Regime Type",
color=c("seashell4","seashell3"))

# FIT count labels
text(x=.3,y=.925,labels="47 countries",cex=.9)
text(x=.8,y=.925,labels="13 countries",cex=.9)
text(x=.3,y=.35,labels="68 countries",cex=.9)
text(x=.8,y=.35,labels="60 countries",cex=.9)

#===============================
dev.off()
#===============================
